#!/bin/bash
#
# Copyright (c) 2016-2020 The Brenwill Workshop Ltd.
#
# generateSPIRVShaders - Convert GLSL shader files to SPIRV header files
#
# macOS usage: ./generateSPIRVShaders
#

set -e

echo
echo ========== Building MoltenVKShaderConverter tool ==========
echo

cd "../../.."

XC_PROJ="MoltenVKPackaging.xcodeproj"
XC_SCHEME="MVKShaderConverterTool Package"

xcodebuild  \
	-project "MoltenVKPackaging.xcodeproj"  \
	-scheme "MVKShaderConverterTool Package"  \
	-quiet  \
	build

echo
echo ========== Converting API-Samples shader files ==========
echo

"Package/Latest/MoltenVKShaderConverter/Tools/MoltenVKShaderConverter"  \
 -r -gi -so -oh -xs . -q  \
 -d "Demos/LunarG-VulkanSamples/VulkanSamples/API-Samples"

cd -  > /dev/null

echo ========== Done! ==========

